#include<stdio.h>

int x[1024] = {1};
int m,k;

void bfs(int t){
    // printf("bfs(%d)\n",t);
    if(t == m+1){
        for(int i=0;i<=m+1;i++)printf("%d ",x[i]);putchar('\n');return;
        /*
        long long p = 1;
        long long s = 0;
        int i;
        for(i=1;i<m+2;i++)p*=x[i];//printf("p=%ld",p);
        for(i=1;i<m+2;i++)s+=p/x[i];//printf("s=%ld\n",s);
        if(s==p){
            for(i=0;i<m+1;i++)printf("%d ",x[i]);
            printf("n=%d\n",x[m+1]-k);
        }return;*/
    }

    int i,upb,lwb;
    double c = 1;
    for(i=1;i<=t;i++){
    	c-=1.0/x[i];
    	//printf("c=%lf\n",c);
    	if(c<0)return;
    }
    upb = (m-t+1) / c;
    lwb = x[t];
    //printf("c=%lf lwb=%d upb=%d\n",c,lwb,upb);
    //for(i=0;i<=t;i++)printf("%d ",x[i]);putchar('\n');
    for(i=lwb+1;i<upb;i++){
        x[t+1] = i;
        bfs(t+1);
    }
}


int main(){
    printf("m(son),k(nbr): ");
    scanf("%d%d",&m,&k);
    bfs(0);
    return 0;
}
